package xhwl.insurance.http.api;

import com.google.gson.Gson;

import okhttp3.RequestBody;
import rx.Observable;
import xhwl.insurance.http.ApiService;
import xhwl.retrofitrx.BaseApi;

/**
 * Created by fuyi on 2017/11/29.
 */

public class ExpertListApi extends BaseApi{
    ExpertListReq req;
    public ExpertListApi( String expert_name,int page_num){
        req=new ExpertListReq(expert_name,page_num);
    }
    @Override
    protected Observable getObservable() {
        RequestBody requestBody = RequestBody.create(okhttp3.MediaType.parse("application/json; charset=utf-8"), new Gson().toJson(req));
        return retrofit.create(ApiService.class).getExpertList(requestBody);
    }
    private class ExpertListReq{
        private int page_num;
        private String expert_name;

        public ExpertListReq(String expert_name,int page_num) {
            super();
            this.page_num = page_num;
            this.expert_name = expert_name;

        }
    }

}


